package com.platform.hjt.sys.model.json;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializerProvider;

import com.platform.hjt.sys.model.SysCompanyInfo;

public class SysCompanyInfoSerialize extends JsonSerializer<SysCompanyInfo>{

	@Override
	public void serialize(SysCompanyInfo sysCompanyInfo, JsonGenerator jgen,
			SerializerProvider arg2) throws IOException,
			JsonProcessingException {
		ObjectMapper om = new ObjectMapper();
		Map<String, String> map = new HashMap<String, String>();
		map.put("sysCompanyInfoId", sysCompanyInfo.getSysCompanyInfoId());
		map.put("companyName", sysCompanyInfo.getCompanyName());
		om.writeValue(jgen, map);
	}

}
